package com.bappi.custom.activities;

import android.app.AlertDialog;
import android.app.TabActivity;
import android.content.DialogInterface;

public class CustomTabActivity extends TabActivity{

	@Override
	public void finish() {
		buildAlertMessageExit();
	}

	public void exit() {
		super.finish();
	}

	private void buildAlertMessageExit() {
		final AlertDialog.Builder builder = new AlertDialog.Builder(this);
		builder.setMessage("Are you sure to exit?")
				.setCancelable(false)
				.setPositiveButton("Yes",
						new DialogInterface.OnClickListener() {
							public void onClick(final DialogInterface dialog,
									final int id) {
								exit();
							}
						})
				.setNegativeButton("No", new DialogInterface.OnClickListener() {
					public void onClick(final DialogInterface dialog,
							final int id) {
					}
				});
		final AlertDialog alert = builder.create();
		alert.show();
	}
}
